ASM_FLAG = -felf64
CC_FLAG = -c -std=c2x -ffreestanding -m64 -mcmodel=large -nostdlib -nostdinc -fPIE -Wall

build:
	nasm $(ASM_FLAG) Entry.asm -o Entry.o
	cc $(CC_FLAG) kernel.c
	ld *.o -o kernel.elf -T linker.ld
	objcopy -I elf64-x86-64 -S -j ".text" -j ".data" -j ".rodata" -j ".bss" -O binary kernel.elf kernel.sys